<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>	管理员操作</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta http-equiv="Access-Control-Allow-Origin" content="*">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="/css/Adindex.css" media="all" />
</head>
<body class="main_body">
	<div id="app" class="layui-layout layui-layout-admin">
		<!-- 顶部 -->
		<div class="layui-header header">
			<div class="layui-main mag0">
				<a href="#" class="logo"></a>

				<h2 style="color: white ">管理员系统</h2>

			    <!-- 顶部右侧菜单 -->
			    <ul class="layui-nav top_menu">
					<li class="layui-nav-item" pc>
						<a href="javascript:;" class="clearCache"><i class="layui-icon" data-icon="&#xe640;">&#xe640;</i><cite>清除缓存</cite><span class="layui-badge-dot"></span></a>
					</li>

					<li class="layui-nav-item" id="userInfo">

						<a href="javascript:;"><img src="images/face.jpg" class="layui-nav-img userAvatar" width="35" height="35"><cite class="adminName">{{username}}<span>[{{roles}}]</span></cite></a>
						<dl class="layui-nav-child">
							<dd><a href="javascript:;" class="showNotice"><i class="layui-icon">&#xe645;</i><cite>系统公告</cite><span class="layui-badge-dot"></span></a></dd>
							<dd pc><a href="javascript:;" class="functionSetting"><i class="layui-icon">&#xe620;</i><cite>功能设定</cite><span class="layui-badge-dot"></span></a></dd>
							<dd pc><a href="javascript:;" class="changeSkin"><i class="layui-icon">&#xe61b;</i><cite>更换皮肤</cite></a></dd>
							<dd><a onclick="if (confirm('是否退出？？')){ sessionStorage.clear();}else{return false;}" href="sysAdmin/login/AdminLogin.html" class="signOut" ><i class="seraph icon-tuichu"></i><cite>退出</cite></a></dd>
						</dl>
					</li>
				</ul>
			</div>
		</div>
		<!-- 左侧导航 -->
		<div class="layui-side layui-bg-black">
			<div class="user-photo">
				<a class="img" title="我的头像" ><img src="images/face.jpg" class="userAvatar"></a>
				<p>你好！<span class="userName"><span>{{username}}</span> 欢迎登录</span></p>



			</div>

			<ul class="layui-nav layui-nav-tree"  lay-filter="pname">
				<li v-for="item in pers" class="layui-nav-item layui-nav-itemed">
					<template v-if="item.parentid == null">
					<a class="" >{{item.pname}}</a>
						<dl class="layui-nav-child">
						<dd v-for="sec in pers">
						<a v-if="sec.parentid == item.perid && sec.type =='menu'" :href="sec.url" target="zhuti">{{sec.pname}}</a>
						</dd>
						</dl>
					</template>
				</li>

			</ul>

		<!-- 右侧内容 -->

		<div class="layui-body layui-form">
			<div class="layui-tab mag0" lay-filter="bodyTab" id="top_tabs_box">
				<ul class="layui-tab-title top_tab" id="top_tabs">
					<li class="layui-this" lay-id=""><i class="layui-icon">&#xe68e;</i> <cite>后台首页</cite></li>
				</ul>
				<ul class="layui-nav closeBox">
				  <li class="layui-nav-item">
				    <a href="javascript:;"><i class="layui-icon caozuo">&#xe643;</i> 页面操作</a>
				    <dl class="layui-nav-child">
					  <dd><a href="javascript:;" class="refresh refreshThis"><i class="layui-icon">&#x1002;</i> 刷新当前</a></dd>
				      <dd><a href="javascript:;" class="closePageOther"><i class="seraph icon-prohibit"></i> 关闭其他</a></dd>
				      <dd><a href="javascript:;" class="closePageAll"><i class="seraph icon-guanbi"></i> 关闭全部</a></dd>
				    </dl>
				  </li>
				</ul>
                <div class="layui-tab-content clildFrame">
                </div>
			</div>
		</div>

	</div>

	</div>
    <div class="layui-body clildFrame">
        <!-- 内容主体区域 -->
        <iframe id="iframe" src="page/main.html" name="zhuti" height="100%" style="width: 100%" frameborder="0"></iframe>

    </div>

	<!-- 移动导航 -->
	<div class="site-tree-mobile"><i class="layui-icon">&#xe602;</i></div>
	<div class="site-mobile-shade"></div>

	<script type="text/javascript" src="/layui/layui.js"></script>
	<script type="text/javascript" src="/js/index.js"></script>
	<script type="text/javascript" src="/js/cache.js"></script>
	<script type="text/javascript" src="/js/vue.js"></script>
	<script type="text/javascript" src="/js/json2.js"></script>
    <script type="text/javascript">
        function changeFrameHeight()
        {
            //期待你们的终极解决方案：代码改动最少，效果还very ok
            setTimeout(function () {
                document.getElementById("iframe").height=0;
                document.getElementById("iframe").height=document.getElementById("iframe").contentWindow.document.body.scrollHeight + 50;
            },500)

        }

        window.onresize=function(){
            changeFrameHeight();

        }
    </script>
<script>
    layui.use('element', function(){
        var element = layui.element;
    });
var vm =new  Vue({
    el : '#app',
	data:{
	    username:'',
        login_ad:null
	},
	computed : {
		pers:function () {
			return this.login_ad.user_pers;
        },
        roles:function(){
		 let  str ="";
		    for(let hisrole of this.login_ad.user.hisroles){
		        str += hisrole.rolelabel;
			}
			return str;
        }
	},

	created : function () {
	    var data=JSON.parse(sessionStorage.getItem("login_user"));
       this.login_ad=data;
        this.username=data.user.username;

	}
});
</script>
</body>

</html>